import java.io.*;

public class ZhuanHuanLiuDemo {
    public static void main(String[] args) {
        try(InputStreamReader inputStreamReader = new InputStreamReader(
                new FileInputStream("E:\\IO流练习\\字符流\\FileRead\\1.txt"));
            OutputStreamWriter outputStreamWriter =new OutputStreamWriter(
                    new FileOutputStream("E:\\IO流练习\\字符流\\FileWrite\\2.txt"),"GBK")
            ) {
            System.out.println(inputStreamReader.getEncoding());
            System.out.println((char) inputStreamReader.read());
            System.out.println(outputStreamWriter.getEncoding());
            outputStreamWriter.write("放票了" + System.lineSeparator());
            outputStreamWriter.write("没抢到" + System.lineSeparator());
            outputStreamWriter.write("加入候补了" + System.lineSeparator());
            outputStreamWriter.write("等待中ing..." + System.lineSeparator());
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
